package com.sky.mapper.admin;

import com.sky.pojo.Dish;
import com.sky.pojo.SetmealDish;
import org.apache.ibatis.annotations.*;

import java.util.List;


/**
 * 套餐和菜品的关系 Mapper
 */
@Mapper
public interface SetmealDishMapper {

    /**
     * 保存套餐
     * @param
     */
    void addSetmeadDish(Long dishId);

    /**
     * 删除套餐关系
     * @param SetmeaId
     */
    @Update("delete from setmeal_dish where setmeal_id=#{SetmeaId}")
            void romveSD(Long SetmeaId);

    /**
     * 更新套餐关系
     * @param setmealDishes
     */
    void upde(List<SetmealDish> setmealDishes);


    /**
     * 根据菜品id分类 发挥菜品
     * @param categoryId
     * @return
     */
    @Select("select name, category_id categoryId, price, image, description, status from dish" +
            "    where  category_id=#{categoryId}")
    List<Dish> getDisdById(@Param("categoryId") Long categoryId);
}